package atm.com.service.admin;

import atm.com.mapper.AdminMapper;
import atm.com.pojo.Admin;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import io.swagger.models.auth.In;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * AdminServiceImpl class
 * @author di zhang
 * @date 2021/8/24
 */

@Service
public class AdminServiceImpl implements AdminServiceInf{

    @Autowired
    private AdminMapper adminMapper;

    @Override
    public Integer GetAdmin(Admin admin) {
        QueryWrapper<Admin> queryWrapper=new QueryWrapper<>();
        queryWrapper.lambda().eq(Admin ::getAdminName,admin.getAdminName())
        .or().eq(Admin::getAdminPassword,admin.getAdminPassword());
        return   adminMapper.selectCount(queryWrapper);
    }

}
